package com.bwie.controller;

import com.bwie.pojo.vo.MuneVo;
import com.bwie.service.LoginService;
import com.bwie.pojo.Result;
import com.bwie.pojo.dto.UserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("login")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("login")
    @ResponseBody
    public Result login(@RequestBody UserDto userDto) throws Exception {
        return  loginService.login(userDto);
    }


    @ResponseBody
    @PostMapping("getMuneVo")
    public List<MuneVo> getMuneVo(){
        return loginService.getMuneVo();
    }
}
